package com.benz.order.util.exception;

public class DivideTest {
    public static void main(String[] args) {
        int ret = 0;
        try {
            ret = divide(4,-2);
            System.out.println("<UNK>");
        } catch (DivideByMinusException e) {
            System.out.println(e.getMessage());
        }
        System.out.println("ret:"+ret);
    }
    static int divide(int x,int y) throws DivideByMinusException{
        if(y<0){
            throw new DivideByMinusException("除数是负数");
        }
        int ret = x/y;
        return ret;
    }
}
